<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=yes">

    <meta content="telephone=yes,email=yes" name="format-detection">
    <!--//自动识别电话号码和邮箱-->

    <meta content="yes" name="apple-mobile-web-app-capable">
    <!--//苹果手机：会删除默认的工具栏和菜单栏，网站开启对web app程序的支持-->
    <meta name="apple-mobile-web-app-status-bar-style" content="default"/>
    <!--//苹果手机：在web app应用下状态条（屏幕顶部条）的颜色,默认值为default（白色），可以定为black（黑色）和black-translucent（灰色半透明）。-->
    <meta name="apple-touch-fullscreen" content="yes"/>
    <!--//苹果手机：如果把一个web app添加到了主屏幕中，那么从主屏幕中打开这个web app则全屏显示-->
    <link rel="apple-touch-icon" href="images/HTML5_Badge_64.png"/>
    <!--//苹果手机：将应用添加到手机主屏幕，会有一个icon可以直接进入-->
    <title>有收入</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <!--初始化样式-->
    <link rel="stylesheet" href="css/reset.css">
    <!--共用样式-->
    <link rel="stylesheet" href="css/common.css">
    <!--整个网站的局部样式-->
    <link rel="stylesheet" href="css/style.css">
    <!--适配样式-->
    <link rel="stylesheet" href="css/styleMedia.css">
    <style>
        html, body {
            position: relative;
            overflow-x: hidden;
        }
    </style>
</head>
<body style="background-color: #ffffff;">

<!--header begin-->
<header>
    <div id="flexHeader">
        <div class="div1 mui-action-back"><a><img src="images/icon_arrow_left.png"></a></div>
        <div class="div2">我的申述</div>
        <div class="div3"></div>
    </div>
</header>
<!--header end-->

<!--Merchant merchandise begin-->
<article class="merchant-merchandise height-padding">
    <div class="businessId">商家ID:<span>117987</span></div>
    <main>
        <div><img id="goodsPic" src=""></div>
        <aside>
            <div>商品目标：<span id="goodsName"></span></div>
            <div>搜索展示价格：<span id="phonePrice"></span></div>
            <div>数量：<span id="goods1ItemNum">1件</span></div>
        </aside>
    </main>
</article>
<!--Merchant merchandise end-->

<!--accept an assignment begin-->
<article class="accept-an-assignment">
    <section class="serial-number serial-number-show">
        <div>
            <p>任务编号</p>
            <p id="orderId">2345254</p>
        </div>
        <div>
            <p>申诉时间</p>
            <p id="ct">2018-10-20&nbsp;20:20:20</p>
        </div>
        <div>
            <p>投诉类型</p>
            <p id="type">资金问题</p>
        </div>
        <div>
            <p>申诉状态</p>
            <p><span id="status">已完结</span></p>
        </div>
    </section>
</article>
<!--accept an assignment end-->

<!--content img-->
<article class="appeal-content-img">
    <section>
        <label>申诉内容</label>
        <textarea disabled  cols="47" rows="8" id="content"></textarea>
    </section>
    <section>
        <label>申诉图片</label>
        <main>
            <div><img id="pic1" src=""></div>
            <div><img id="pic2" src=""></div>
        </main>
    </section>
</article>

<!--js-->
<script src="js/mui.min.js"></script>
<script src="js/vconsole.min.js"></script>
<script src="js/jquery-1.12.3.min.js"></script>
<script src="js/common.js"></script>
<script src="js/config.js"></script>
<script>
	
	var vc = new VConsole()
	var id
	$(function () {
		id = getUrlParam('id')
		$.ajax({
			type:"get",
			url: $CONFIG.baseUrl + "/api/appeal/" + id,
			async:true,
			beforeSend:function(x){
				x.setRequestHeader("Authorization", localStorage.getItem('token'))
			},
			success: function (data) {
				if (data.msg = 200) {
					console.log(JSON.stringify(data.data))
					init(data.data)
				}
			}
		})
	})
	
	function init(data) {
		$('#orderId').html(data.appeal.orderId)
		$('#ct').html(data.appeal.ct)
		$('#content').html(data.appeal.content)
		$('#type').html(data.appeal.type == 0 ? "资金问题" : "其它问题")
		$('#status').html(function () {
			var x = ''
			switch (data.appeal.status){
				case 0:
				  x = "处理中";
				  break;
				case 1:
				  x = "已完结";
				  break;
				case 1:
				  x = "申诉驳回";
				  break;
			}
			return x
		})
		if (data.appeal.pic1) {
			$("#pic1").attr("src", $IMG_CONF + data.appeal.pic1)
		}
		if (data.appeal.pic2) {
			$("#pic2").attr("src", $IMG_CONF + data.appeal.pic2)
		}
		
		$("#goodsPic").attr("src", $IMG_CONF + data.task.goods1Pic)
		$('#goodsName').html(data.task.goodsName)
		$('#phonePrice').html(data.task.phonePrice + "元")
		$('#goods1ItemNum').html(data.task.goods1ItemNum)
	}
</script>

</body>
</html>